﻿
$("#RoleAddTUser").click(function () {
    debugger;
    $.ajax({
        url: "/Account/RoleAddToUser",
        type: "GET",

        success: function (result) {

            $("#addtouser").dialog({
                width: 700,
                height: 500,
                show: {

                    buttons: {

                        Cancel: function () { $(this).dialog("close") }

                    }

                },
                hide: {
                    effect: "explose",
                    duration: 1000,

                }
            });





            $("#addtouser").html(result);




        }
    });
})
function validate(){

    $("#rolecreaterole").html("this is invalid name ");
}
$("#Create_Role").click(function () {

    $.ajax({
      
        url: "/Account/RoleCreate",
        type: "GET",
        
        success: function (result) {
               $("#RoleCreate").dialog({
                width: 300,
                height: 200,
                show: {
                    buttons: {
                        
                       Cancel: function () { $(this).dialog("close") }
                               }

                },
                hide: {
                    effect: "explose",
                    duration: 1000,
                }
            });

            $("#RoleCreate").html(result);

        }

       
    });
})

$('#ButtonID').click(function () {
    var url = "/Account/TellMeDate";
    $.get(url, null, function (data) {
        $("rData").html(data)
    })
});


function DeleteRole(name) {
    $.ajax({
        type: 'post',
        datatype: 'json',
        cache: true,
        url: '/Account/RoleDelete',
        data: { RoleName: name },

        success: function (response) {
            response.Status;
            var output = response.Status;
            $("#responseSuccess").html(response.Status).slideDown();
            location.reload();
        },


        error: function (response) {
            response.Status;
        }

    });


}






$(document).ready(function () {
    $("#flip").click(function () {
        $("#panel").slideToggle("slow");
    });
});
